import 'package:json_annotation/json_annotation.dart';

part 'health_log.g.dart';

@JsonSerializable()
class HealthLogReq {
  final int lastItemTime;

  ///体重：weight；神经：nervous；消耗：digestive；呼吸：respiratory；运动：motor；内分泌：endocrine,
  final String logType;
  final int pageSize;

  HealthLogReq(this.lastItemTime, this.logType, this.pageSize);

  factory HealthLogReq.fromJson(Map<String, dynamic> json) =>
      _$HealthLogReqFromJson(json);

  Map<String, dynamic> toJson() => _$HealthLogReqToJson(this);
}

@JsonSerializable()
class HealthLogModel {
  final bool enabled;
  final List<HealthLogDataInfo> list;

  HealthLogModel(this.enabled, this.list);

  factory HealthLogModel.fromJson(Map<String, dynamic> json) =>
      _$HealthLogModelFromJson(json);

  Map<String, dynamic> toJson() => _$HealthLogModelToJson(this);
}

@JsonSerializable()
class HealthLogDataInfo {
  final int clearingTime;
  final String desc;

  HealthLogDataInfo(this.clearingTime, this.desc);

  factory HealthLogDataInfo.fromJson(Map<String, dynamic> json) =>
      _$HealthLogDataInfoFromJson(json);

  Map<String, dynamic> toJson() => _$HealthLogDataInfoToJson(this);
}
